﻿using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Himall.Entity.Config
{
   public class ArticleInfoConfig : EntityTypeConfiguration<ArticleInfo>
    {
        public ArticleInfoConfig()
        {
            ToTable("Himall_Articles");
            Property(item => item.Title).HasColumnType("varchar").HasMaxLength(100);
            Property(item => item.IconUrl).HasColumnType("varchar").HasMaxLength(100);
            Property(item => item.Content).HasColumnType("text");
            Property(item => item.Meta_Description).HasColumnType("text");
            Property(item => item.Meta_Keywords).HasColumnType("text");
            Property(item => item.Meta_Title).HasColumnType("text");
            HasRequired(x => x.ArticleCategoryInfo).WithMany(x => x.ArticleInfo).HasForeignKey(x => x.CategoryId);
        }
    }
}
